﻿/* ######################################## *\
 * ### Copyright (C) 2009 AJ Ravindiran ### *
\* ######################################## */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using AJRavindiran.Jolt.RuneScape.Models.Characters.Information;
using AJRavindiran.Jolt.RuneScape.Models.Characters.Request;

namespace AJRavindiran.Jolt.RuneScape.Models.Characters
{
    /// <summary>
    /// Represents an entity of the character in the game world.
    /// </summary>
    public abstract class Entity
    {
        #region Fields
        private Location location;
        private Location teleportTo;
        private Animation lastAnimation;
        private Graphics lastGraphics;
        #endregion Fields

        #region Constructors
        /// <summary>
        /// Constructs a new entity.
        /// </summary>
        public Entity()
        {
            this.location = RuneScape.GetConfigManager().General.SpawnPoint;
            this.teleportTo = null;
            this.lastGraphics = null;
            this.lastAnimation = null;
        }
        #endregion Constructors

        #region Methods
        /// <summary>
        /// Get accessor the the entity location.
        /// </summary>
        public Location GetLocation()
        {
            return this.location;
        }

        /// <summary>
        /// Set the location of a player.
        /// </summary>
        public void SetLocation(Location location)
        {
            this.location = location;
        }

        /// <summary>
        /// Get accessor for the entity teleport to.
        /// </summary>
        public Location GetTeleportTo()
        {
            return this.teleportTo;
        }

        /// <summary>
        /// Sets the location to teleport to.
        /// </summary>
        public void Teleport(Location location)
        {
            this.teleportTo = location;
        }

        /// <summary>
        /// Resets the teleport to location.
        /// </summary>
        public void ResetTeleportTo()
        {
            this.teleportTo = null;
        }

        public abstract void AppendGraphics(int id);
        public abstract void AppendGraphics(int id, int delay);
        public abstract void AppendAnimation(int id);
        public abstract void AppendAnimation(int id, int delay);

        public Graphics GetLastGraphics()
        {
            return this.lastGraphics;
        }

        public void SetLastGraphics(Graphics lastGraphics)
        {
            this.lastGraphics = lastGraphics;
        }

        public Animation GetLastAnimation()
        {
            return this.lastAnimation;
        }

        public void SetLastAnimation(Animation lastAnimation)
        {
            this.lastAnimation = lastAnimation;
        }
        #endregion Methods
    }
}
